#include <stdio.h>
#include <stdlib.h>
#include "basics.h"
#include "options.h"
#include "parser.h"

extern void init_config(void);
extern void init_threads(void);
extern void init_signals(void);
extern void init_target_config(void);
extern void simcore_start(void);
extern void interface_wait(void);

int main(int argc, char ** argv)
{

	init_signals();

	init_target_config();

	(void) process_opts(argc, argv);

	banner_print();

	consolidate();

	LOG_INIT();

	if (options.config_filep != (char *)0)
		parse_config_file();

	init_config();
	init_threads();

		/*
		 * Simulator configured by this point
		 * simulation can proceed from here on.
		 */

	if (options.flag_auto_start) simcore_start();

	interface_wait();

	return (0);	/* compiler joy */
}
